package com.ibm.risk.irmp.report.entity;

import jakarta.persistence.*;
import lombok.Data;

import java.util.List;

@Data
//@Accessors(chain = true)
@Entity
@Table(name = "ri_rpt_group")
public class ReportGroup {
    @Id
    private String groupCode;
    private String groupName;
    private String groupDesc;
    @OneToMany
    @JoinColumn(name = "parent_group")
    private List<ReportGroup> subGroups;

    @ManyToMany
    @OrderBy("seq")
    @JoinTable(name = "ri_rpt_group_report",
            joinColumns = @JoinColumn(name = "group_code"), inverseJoinColumns = @JoinColumn(name = "report_code"))
    private List<ReportDef> reports;
}
